//package com.boot.export.program.pdf;
//
//import com.itextpdf.text.*;
//import com.itextpdf.text.pdf.BaseFont;
//import com.itextpdf.text.pdf.PdfPCell;
//import com.itextpdf.text.pdf.PdfPTable;
//import com.itextpdf.text.pdf.PdfWriter;
//import io.netty.util.internal.StringUtil;
//import org.apache.commons.io.FileUtils;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.io.FileNotFoundException;
//import java.io.FileOutputStream;
//
///**
// * springboot为导出的pdf和excel加水印
// * https://www.cnblogs.com/scuury/p/10234744.html
// * <p>
// * 史上最全的springboot导出pdf文件
// * https://www.cnblogs.com/scuury/p/10093287.html
// */
//@RestController
//public class ExportPDF {
//
//    @Value("${export.outpath}")
//    private String outFile;
//
//    public void exportForHelloWorld(){
//        Document document = new Document();
//        try {
//            PdfWriter.getInstance(document, new FileOutputStream(outFile+"zhang-helloWorld.pdf"));
//            document.addTitle("first example export pdf");
//            document.open();
//            document.add(new Paragraph("Hello World"));
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            document.close();
//        }
//    }
//
//    // 两行两列
//    public void exportForSimpleTable(){
//        Document document = new Document();
//        try {
//
//            PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(outFile + "zhang_simple_table.pdf"));
//            document.addTitle("first example export simple pdf");
//            document.open();
//
//            PdfPTable pdfPTable = new PdfPTable(2);
//            PdfPCell cell1 = new PdfPCell(new Phrase("a"));
//            cell1.setFixedHeight(15);
//            pdfPTable.addCell(cell1);
//            PdfPCell cell2 = new PdfPCell(new Phrase("b"));
//            cell2.setFixedHeight(15);
//            pdfPTable.addCell(cell2);
//            PdfPCell cell3 = new PdfPCell(new Phrase("c"));
//            cell3.setFixedHeight(15);
//            pdfPTable.addCell(cell3);
//            PdfPCell cell4 = new PdfPCell(new Phrase("d"));
//            cell4.setFixedHeight(15);
//            pdfPTable.addCell(cell4);
//
//            pdfPTable.addCell("1.1");
//            pdfPTable.addCell("1.2");
//            pdfPTable.addCell("2.1");
//            pdfPTable.addCell("aaa");
//
//            document.add(pdfPTable);
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            document.close();
//        }
//    }
//
//    /**
//     * Difficult 复杂
//     */
//    public void exportForDifficultTable(){
////        Document document = new Document();
////        try {
////            PdfWriter pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(outFile + "zhang_difficult_table.pdf"));
////            document.addTitle("first example export pdf");
////            document.open();
////            document.add(new Paragraph("difficult content"));
////        } catch (Exception e) {
////            e.printStackTrace();
////        } finally {
////            document.close();
////        }
//    }
//
//    public static void main(String[] args) throws FileNotFoundException {
//
//    }
//
//
//}
